<?php

namespace JsonLowCode\UI;

use JsonLowCode\Schema;

/**
 * KeepRouter 组件
 */
class KeepRouter extends Schema
{
    protected string $componentName = "KeepRouter";

    public function __construct()
    {
        parent::__construct();
        $this->name("fade-slide");
    }

     /**
     * 设置路由切换方式
     * @param string $name 'zoom-fade' = '渐变','zoom-out' = '闪现','fade-slide' = '滑动','fade' = '消退','fade-bottom' = '底部消退','fade-scale' = '缩放消退'
     * @return $this
     */
    public function name(string $name): KeepRouter
    {
        return $this->prop("name",$name);
    }

    /**
     * 设置组件cacheRoutes属性值
     * @param mixed $value 属性值value
     * @return $this
     */
    public function cacheRoutes(mixed $value): static
    {
        return $this->prop('cache-routes',$value);
    }
}
